package com.byd.web.controller;

import com.byd.web.common.R;
import com.byd.web.service.IActivitiService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;

@RestController
@RequestMapping("/mail")
public class MailController {

    @Resource
    private IActivitiService activitiService;

    @GetMapping("/send")
    public R<?> sendEmail(@RequestParam String userIds) {
        String[] ids = userIds.split(",");
        return R.ok(activitiService.sendEmail(Arrays.asList(ids)));
    }
}
